package factorymethod

import (
	"fmt"
)

// 支付宝支付网关
type AliPay struct {
	appId     string
	appSecret string
}

func NewAliPay(appId, appSecret string) *AliPay {
	return &AliPay{
		appId:     appId,
		appSecret: appSecret,
	}
}

func (a *AliPay) Pay(amount int64) (string, error) {
	// 调用支付宝支付接口
	return fmt.Sprintf("alipay pay %d", amount), nil
}

func (a *AliPay) Refund(orderId string) error {
	return fmt.Errorf("alipay refund %s", orderId)
}
